<?php 
global $header;
global $footer;
global $control;
global $message;
global $serial, $term_serial, $preferred_term,$definition,$word_class,$national_variants,$admitted_terms,$deprecated_terms,$abbreviation,$acronym,$full_forms,$source_location,$subject_field,$broader_term,$narrower_term,$synonym,$name_of_creators,$notes, $error;
global $glossary;

global $featureManager;
$header['title'] = $glossary['abbr'] != ""?$glossary['abbr']:$glossary['title'];
$header['head'] = '
<script type="text/javascript" src="'.RESOURCE_BASE.'glossary/base.js"></script>
';
$header['intro'] = '<em class="title">'.$glossary['title'].'</em>';
$featureManager->apply("com.yizin.platform.site.header", $header);
$featureManager->apply("com.yizin.platform.site.footer", $footer);
$featureManager->apply("com.yizin.platform.site.control", $control);

if(count($terms) == 0) $isget = TRUE;
?>
<?= $header['html']?>
<div class="container-L">
	<?=$control['html']?>
</div>
<div class="container-R">
	<?=Utils::showMessage($message)?>
	<?=Utils::loadSegment(dirname(__FILE__)."/segments/_s_glossary_toolbar_.php")?>
	<h3>Edit a term</h3>
	<form action="<?=REQUEST_BASE?>glossary/<?=$serial?>/term/<?=$term_serial?>/edit/" method="post">
		<input type="hidden" name="next" id="next" value="false" />
		<table class="form">
			<tr>
				<th><label for="preferred_term"><em class="required">*</em>Preferred term</label></th>
				<td>
					<input type="text" name="preferred_term" id="preferred_term" class="text text-long" value="<?=$preferred_term?>" />
					<?=Utils::showFormError($error)?>
				</td>
			</tr>
			<tr>
				<th><label for="definition"><em class="required">*</em>Definition</label></th>
				<td><textarea name="definition" rows="3" id="definition" class="text"><?=$definition?></textarea></td>
			</tr>
			<tr>
				<th><label for="word_class">Word class</label></th>
				<td><input type="text" name="word_class" id="word_class" class="text text-long" value="<?=$word_class?>" /></td>
			</tr>
			<tr>
				<th><label for="national_variants">National variants</label></th>
				<td><input type="text" name="national_variants" id="national_variants" class="text text-long" value="<?=$national_variants?>" /></td>
			</tr>
			<tr>
				<th><label for="admitted_terms">Admitted term(s)</label><br /><span class="below-label">(seperate with semicolon <code>;</code>)</span></th>
				<td><textarea rows="3" name="admitted_terms" id="admitted_terms" class="text"><?=$admitted_terms?></textarea></td>
			</tr>
			<tr>
				<th><label for="deprecated_terms">Deprecated term(s)</label><br /><span class="below-label">(seperate with semicolon <code>;</code>)</span></th>
				<td><textarea rows="3" name="deprecated_terms" id="deprecated_terms" class="text"><?=$deprecated_terms?></textarea></td>
			</tr>
			<tr>
				<th><label for="abbreviation">Abbreviation</label></th>
				<td><input type="text" name="abbreviation" id="abbreviation" class="text text-long" value="<?=$abbreviation?>" /></td>
			</tr>
			<tr>
				<th><label for="acronym">Acronym</label></th>
				<td><input type="text" name="acronym" id="acronym" class="text text-long" value="<?=$acronym?>" /></td>
			</tr>
			<tr>
				<th><label for="full_forms">Full forms</label><br /><span class="below-label">(seperate with semicolon <code>;</code>)</span></th>
				<td><textarea rows="3" name="full_forms" id="full_forms" class="text"><?=$full_forms?></textarea></td>
			</tr>
			<tr>
				<th><label for="source_location">Source location</label><br /><span class="below-label">(start with <code>http://</code>)</span></th>
				<td><textarea rows="3" name="source_location" id="source_location" class="text"><?=$source_location?></textarea></td>
			</tr>
			<tr>
				<th><label for="subject_field">Subject field</label><br /><span class="below-label">(seperate with semicolon <code>;</code>)</span></th>
				<td><textarea rows="3" name="subject_field" id="subject_field" class="text"><?=$subject_field?></textarea></td>
			</tr>
			<tr>
				<th><label for="broader_term">Broader term</label></th>
				<td><input type="text" name="broader_term" id="broader_term" class="text text-long" value="<?=$broader_term?>" /></td>
			</tr>
			<tr>
				<th><label for="narrower_term">Narrower term</label></th>
				<td><input type="text" name="narrower_term" id="narrower_term" class="text text-long" value="<?=$narrower_term?>" /></td>
			</tr>
			<tr>
				<th><label for="synonym">Synonym</label></th>
				<td><input type="text" name="synonym" id="synonym" class="text text-long" value="<?=$synonym?>" /></td>
			</tr>
			<tr>
				<th><label for="name_of_creators">Name of creator(s)</label><br /><span class="below-label">(seperate with semicolon <code>;</code>)</span></th>
				<td><textarea rows="3" name="name_of_creators" id="name_of_creators" class="text"><?=$name_of_creators?></textarea></td>
			</tr>
			<tr>
				<th><label for="notes">Notes</label></th>
				<td><textarea rows="3" name="notes" id="notes" class="text"><?=$notes?></textarea></td>
			</tr>
			<tr>
				<td></td><td>
					<input type="submit" value="Submit" class="button" />
				</td>
			</tr>
		</table>
	</form>
</div>
<?= $footer['html']?>
